home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
howtos1r
/
frmview.frm
< prev
next >
Wrap
Text File
|
1999-08-11
|
4KB
|
128 lines
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
Begin VB.Form frmView
BackColor = &H00000000&
BorderStyle = 1 'Fixed Single
Caption = "View Current Graph"
ClientHeight = 2550
ClientLeft = 45
ClientTop = 330
ClientWidth = 6060
Icon = "frmView.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 170
ScaleMode = 3 'Pixel
ScaleWidth = 404
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton cmdExport
Caption = "Export To a Bitmap"
Height = 375
Left = 0
TabIndex = 4
Top = 2175
Width = 6060
End
Begin VB.CommandButton cmdClose
Cancel = -1 'True
Caption = "Close"
Height = 375
Left = 0
TabIndex = 2
Top = 1800
Width = 6060
End
Begin VB.HScrollBar Scroll
Height = 240
LargeChange = 100
Left = 0
SmallChange = 10
TabIndex = 1
Top = 1560
Width = 6060
End
Begin VB.PictureBox Picture1
BackColor = &H00000000&
Height = 1620
Left = 0
ScaleHeight = 104
ScaleMode = 3 'Pixel
ScaleWidth = 400
TabIndex = 0
Top = 0
Width = 6060
Begin MSComDlg.CommonDialog Dialog
Left = 1920
Top = 840
_ExtentX = 847
_ExtentY = 847
_Version = 327681
DefaultExt = "*.bmp"
DialogTitle = "Save"
Filter = "Bitmaps|*.bmp"
MaxFileSize = 10000
End
Begin VB.PictureBox picView
AutoRedraw = -1 'True
BackColor = &H00000000&
BorderStyle = 0 'None
Height = 1500
Left = 5040
ScaleHeight = 100
ScaleMode = 3 'Pixel
ScaleWidth = 10
TabIndex = 3
Top = 30
Width = 150
End
End
End
Attribute VB_Name = "frmView"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdClose_Click()
frmGraph.lblopt(0).ForeColor = RGB(0, 255, 0)
Unload Me
End Sub
Private Sub cmdExport_Click()
On Error GoTo Twat:
Dialog.InitDir = App.Path
Dialog.ShowOpen
If Dialog.Filename <> "" Then
SavePicture picView.Image, Dialog.Filename
MsgBox "Saved to '" & Dialog.Filename & "'", vbInformation, "Success"
End If
Exit Sub
Twat:
MsgBox "Could Not Save to '" & Dialog.Filename & "'", vbInformation, "No Success"
End Sub
Private Sub Form_Load()
picView.Width = frmGraph.picGraph.Width
picView.Left = Picture1.ScaleWidth - picView.Width
Scroll.Max = picView.Width
Scroll.Value = Scroll.Max
'NOTE: 1 less than a quater to allow for there being a row valued '0' on the X axis
picView.Line (0, 24)-(picView.ScaleWidth, 24), RGB(128, 128, 128)
picView.Line (0, 49)-(picView.ScaleWidth, 49), RGB(128, 128, 128)
picView.Line (0, 74)-(picView.ScaleWidth, 74), RGB(128, 128, 128)
End Sub
Private Sub Picture1_Click()
frmView.picView.Line (0, 24)-(picView.Width, 24), RGB(255, 255, 255)
frmView.picView.Line (0, 49)-(picView.Width, 49), RGB(255, 255, 255)
frmView.picView.Line (0, 74)-(picView.Width, 74), RGB(255, 255, 255)
End Sub
Private Sub Scroll_Change()
picView.Left = Picture1.ScaleWidth - Scroll.Value
End Sub